import PG from "@/image/new_img/gamelist/gg_pg_v2.png";
import PP from "@/image/new_img/gamelist/gg_pp_v2.png";
import JDB from "@/image/new_img/gamelist/gg_jdb_v2.png";
import EVOPLAY from "@/image/new_img/gamelist/gg_evo_v2.png";
import BGAMING from "@/image/new_img/gamelist/gg_bg_v2.png";
import FC from "@/image/new_img/gamelist/gblogo_fc.png";
import SPINOMENAL from "@/image/new_img/gamelist/gblogo_sp.png";
import faV2 from "@/image/new_img/gamelist/gg_fav_v2.png";
import hotImg from "@/image/new_img/gamelist/gblogo_bw_hot_en.png";
import JILI from "@/image/new_img/gamelist/gblogo_JILI.png";
import Bkash from "@/image/new_img/home/recharge/bkash.png";
import Nagad from "@/image/new_img/home/recharge/nagad.png";
import Rocket from "@/image/new_img/home/recharge/rocket.png";
import Upay from "@/image/new_img/home/recharge/upay.png";

export function coypText(textContent: string) {
  const clipboard = navigator.clipboard || {
    writeText: text => {
      const copyInput = document.createElement("input");
      copyInput.value = text;
      document.body.appendChild(copyInput);
      copyInput.select();
      document.execCommand("copy");
      document.body.removeChild(copyInput);
    },
  };
  if (clipboard) {
    clipboard.writeText(textContent);
  }
}
//获取游戏运营商的图片
export function groupLogolist(name, groupType) {
  if (name === "PG") {
    return PG;
  }
  if (name === "PP") {
    return PP;
  }
  if (name === "JDB") {
    return JDB;
  }
  if (name === "EVOPLAY") {
    return EVOPLAY;
  }
  if (name === "BGAMING") {
    return BGAMING;
  }
  if (name === "FC") {
    return FC;
  }
  if (name === "SPINOMENAL") {
    return SPINOMENAL;
  }
  if (name === "JILI") {
    return JILI;
  }
  if (groupType == 2) {
    return faV2;
  }
  if (groupType == 1) {
    return hotImg;
  }
}
//孟加拉支付渠道
export function BANTypeImg(name) {
  if (name.includes("BDT_BKASH")) {
    return Bkash;
  }
  if (name.includes("BDT_NAGAD")) {
    return Nagad;
  }
  if (name.includes("BDT_UPAY")) {
    return Upay;
  }
  if (name.includes("BDT_ROCKET")) {
    return Rocket;
  }
}
//判断当前使用的语言
export function judgeLang(langName) {
  const lang = "da,de,en,en-stkus,es,fi,fr,id,it,ja,ko,nl,no,pl,pt,ro,ru,sv,th,tr,uk,vi,zh";
  if (lang.includes(langName)) {
    return langName;
  } else {
    return "en";
  }
}
